import torch
import torchvision
from torch.utils.data import DataLoader
dataset = torchvision.datasets.CIFAR10("../CIFAR10_dataset", train=False, transform=torchvision.transforms.ToTensor(),
                                       download=True)
dataloader = DataLoader(dataset, batch_size=64, drop_last=True)


class Wangqi(torch.nn.Module):
    def __init__(self):
        super(Wangqi, self).__init__()
        self.linear1 = torch.nn.Linear(196608, 10)

    def forward(self, input):
        output = self.linear1(input)
        return output



wangqi = Wangqi()

for data in dataloader:
    imgs, targets = data
    print(imgs.shape)
    output = torch.flatten(imgs)
    print(output.shape)
    output = wangqi(output)
    print(output.shape)

